﻿using DeviceMaintainGIS.Entity;
using DeviceMaintainGIS.Model;
using DeviceMaintainGIS.Model.FaultType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeviceMaintainGIS.BLL.FaultType
{
    /// <summary>
    /// 故障类型操作
    /// </summary>
    public class FaultTypeService
    {
        /// <summary>
        /// 获取故障类型
        /// </summary>
        /// <returns></returns>
        public ReturnListVM<FaultTypeResponse> GetFaultType()
        {
            ReturnListVM<FaultTypeResponse> list = new ReturnListVM<FaultTypeResponse>();
            using (CYOADBEntities Entities = new CYOADBEntities())
            {
                var linq = from a in Entities.FaultType_Tab
                           select new FaultTypeResponse
                           {
                               FaultType=a.FaultType,
                               FaultTypeId=a.FaultTypeId
                           };
                list.Succeed = true;
                list.List = linq.ToList();
                return list;
            }
        }
    }
}
